package com.leonzhangxf.spel.reference.bean;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author leonzhangxf
 * @date 20190427
 */
@ToString
public class Society {

    public static final String ADVISORS = "advisors";

    public static final String PRESIDENT = "president";

    @Setter
    @Getter
    private String name;

    @Getter
    private List<Inventor> members = new ArrayList<>();

    @Getter
    private Map<String, Object> officers = new HashMap<>();

    public boolean isMember(String name) {
        for (Inventor inventor : members) {
            if (inventor.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }
}
